package com.dupengcheng.oss.service;


import com.dupengcheng.oss.adapter.StorageAdapter;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;

@Service
public class FileService {

    @Resource
    private StorageAdapter storageAdapter;



    public String getAllBucket(){

        List<String> allBucket = storageAdapter.getAllBucket();

        return allBucket.get(0);
    }

    public void uploadFile(MultipartFile file,String bucketName,String objectName){

        storageAdapter.uploadFile(file,bucketName,objectName);
    }



}
